
import types from "../types/types";
// 定义商品模块的数据
const goodsState = {
    goodsname: '小米13',
    price: 4000
}

// 定义操作商品goods 模块的reducers
function goodsReducer(state = goodsState, action) {
    if (action.type == types.goods.addprice) {
        return {
            ...state,
            price: state.price + action.payload
        }
    }
    return state

}

export default goodsReducer